<?php
    namespace  App\Http\Controllers\Login;

    use App\Http\Controllers\BaseApiController;
    use App\Services\Login\LoginService;
    use App\Http\Controllers\Controller;
    use Illuminate\Http\Request;

    class LoginController extends BaseApiController{
        private $service;

        public function __construct(LoginService $service)
        {
            //继承基类的构造方法
            parent::__construct();
            //依赖注入service
            $this->service=$service;
        }
        /**
         * 登录凭证校验
         */
        public function openid(Request $request){
            //接收$code
            $code = $request->get('code');
            //使用service操作
            return $this->service->openid($code);
        }

    }